Skip to content

Add NetworkStateProvider#1056

Open
0xfornax wants to merge 187 commits into
masterfrom
network-state-provider
Open

Add NetworkStateProvider#1056
0xfornax wants to merge 187 commits into
masterfrom
network-state-provider

Conversation

@0xfornax
Copy link
Copy Markdown
Member

No description provided.

0xfornax and others added 30 commits March 31, 2026 12:10
Server side:
- rocketpool/api/queue/routes.go: RegisterRoutes() for all 6 queue endpoints
- rocketpool/api/service/routes.go: RegisterRoutes() for all 3 service endpoints
- rocketpool/node/routes/routes.go: wire queue and service route registrations
- shared/utils/api/http.go: WriteResponse/WriteErrorResponse helpers

Client side:
- shared/services/rocketpool/queue.go: replace callAPI with callHTTPAPI
- shared/services/rocketpool/service.go: replace callAPI with callHTTPAPI

debug module skipped (handlers write to stdout directly, not JSON API pattern)
Server side (routes.go in each api/ module):
- auction: 10 routes with lotIndex/amountWei param parsing
- network: 9 routes with uint64 param parsing
- wallet: 12 routes; refactor init/recover/test handlers to accept explicit
  params instead of reading CLI flags (c.String/c.Bool/c.Uint)

Client side (shared/services/rocketpool/):
- auction.go, network.go, wallet.go: replace callAPI with callHTTPAPI
Server side:
- security/routes.go: RegisterRoutes() for 18 security endpoints
  (note: ProposeInvite/Kick/KickMulti/Replace have no server-side handlers
  and remain on callAPI in the client)
- megapool/routes.go: RegisterRoutes() for 28 megapool endpoints

Client side:
- security.go: migrate 22 of 26 methods to callHTTPAPI; 4 legacy methods
  (ProposeInvite/Kick/KickMulti/Replace) kept on callAPI (no server handler)
- megapool.go: all methods migrated to callHTTPAPI
Server side:
- minipool/routes.go: RegisterRoutes() for all 31 minipool endpoints
  (status, refund, stake, promote, dissolve, exit, close, delegate-upgrade,
   set-use-latest-delegate, get-use-latest-delegate, get-delegate,
   get-effective-delegate, get-previous-delegate, get-vanity-artifacts,
   begin/can-begin/can-reduce/reduce-bond-amount, distribute-balance,
   import-key, change-withdrawal-creds, rescue-dissolved,
   get-bond-reduction-enabled)

Client side:
- minipool.go: all methods migrated to callHTTPAPI
Server side:
- odao/routes.go: RegisterRoutes() for all odao endpoints
  (status, members, proposals, propose-invite, propose-leave,
   propose-kick, cancel/vote/execute-proposal, join, leave,
   member/proposal/minipool-settings, penalise-megapool,
   all propose-setting variants)
  Note: can-replace/replace have no server handlers; kept on callAPI
- pdao/routes.go: RegisterRoutes() for all pdao endpoints
  (status, proposals, voting, settings, rewards-percentages,
   one-time-spend, recurring-spend, security-council operations,
   claimable-bonds, defeat/finalize-proposal, voting-delegate,
   signalling-address, allow-listed-controllers)

Client side:
- odao.go: all methods migrated to callHTTPAPI except
  CanReplaceTNDAOMember/ReplaceTNDAOMember/CanProposeReplaceTNDAOMember/
  ProposeReplaceTNDAOMember (no server handlers) and
  CanProposeTNDAOSetting (no matching CLI command in odao)
- pdao.go: all methods migrated to callHTTPAPI
Server side:
- node/routes.go: RegisterRoutes() for all node endpoints (status, alerts,
  sync, eth-balance, check-collateral, rewards, deposit-contract-info,
  register, set-timezone, primary/rpl withdrawal addresses, swap/stake/
  unstake rpl, rpl locking, withdraw rpl/eth/credit, deposit, send/burn,
  claim-rpl, fee-distributor, interval rewards, smoothing-pool, ens,
  sign, sign-message, vacant-minipool, send-message, express-tickets,
  unclaimed-rewards, bond-requirement)
- node/routes/routes.go: add noderoutes.RegisterRoutes

Client side:
- node.go: all methods migrated to callHTTPAPI
Wait for validator index to be included in finalized state before calling `GetValidatorProof` in `stake-megapool-validator.go`
chore: correct grammar and word in code comments
0xfornax and others added 24 commits April 30, 2026 09:34
Simplify megapool eligible borrowed eth function
Signed-off-by: criciss <cricis@msn.com>
refactor: use slices.Backward to simplify the code
getNodeMinimumRPLStake -> getNodeMinimumLegacyRPLStake
Make memory improvements to state ssz parsing automatically
Bumps [github.com/ipld/go-ipld-prime](https://github.com/ipld/go-ipld-prime) from 0.22.0 to 0.23.0.
- [Release notes](https://github.com/ipld/go-ipld-prime/releases)
- [Changelog](https://github.com/ipld/go-ipld-prime/blob/master/CHANGELOG.md)
- [Commits](ipld/go-ipld-prime@v0.22.0...v0.23.0)

---
updated-dependencies:
- dependency-name: github.com/ipld/go-ipld-prime
  dependency-version: 0.23.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
…b.com/ipld/go-ipld-prime-0.23.0

Bump github.com/ipld/go-ipld-prime from 0.22.0 to 0.23.0
Signed-off-by: box4wangjing <box4wangjing@outlook.com>
refactor: replace Split in loops with more efficient SplitSeq
# Conflicts:
#	shared/services/ec-manager.go
#	shared/services/requirements.go
@github-actions
Copy link
Copy Markdown

Coverage Report

@0xfornax 0xfornax force-pushed the network-state-provider branch from f148e8f to fafb2ed Compare May 26, 2026 19:10
@github-actions
Copy link
Copy Markdown

Coverage Report

@github-actions
Copy link
Copy Markdown

Merging this branch changes the coverage (1 decrease, 3 increase)

Impacted Packages Coverage Δ 🤖
github.com/rocket-pool/smartnode/rocketpool 0.00% (ø)
github.com/rocket-pool/smartnode/rocketpool/node 0.71% (+0.71%) 👍
github.com/rocket-pool/smartnode/rocketpool/watchtower 0.90% (+0.46%) 👍
github.com/rocket-pool/smartnode/shared/services 0.26% (-0.05%) 👎
github.com/rocket-pool/smartnode/shared/services/proposals 0.00% (ø)
github.com/rocket-pool/smartnode/shared/services/state 6.02% (+0.26%) 👍
github.com/rocket-pool/smartnode/treegen 0.00% (ø)

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/rocket-pool/smartnode/rocketpool/node/node.go 0.00% (ø) 3409 (+70) 0 3409 (+70)
github.com/rocket-pool/smartnode/rocketpool/node/verify-pdao-props.go 5.54% (+5.54%) 2672 (+128) 148 (+148) 2524 (-20) 👍
github.com/rocket-pool/smartnode/rocketpool/rocketpool.go 0.00% (ø) 95 (+7) 0 95 (+7)
github.com/rocket-pool/smartnode/rocketpool/watchtower/generate-rewards-tree.go 0.00% (ø) 1756 (+134) 0 1756 (+134)
github.com/rocket-pool/smartnode/rocketpool/watchtower/submit-network-balances.go 6.20% (+3.19%) 4389 (+326) 272 (+150) 4117 (+176) 👍
github.com/rocket-pool/smartnode/shared/services/bc-manager.go 0.00% (ø) 3138 (+382) 0 3138 (+382)
github.com/rocket-pool/smartnode/shared/services/ec-manager.go 0.00% (ø) 3336 (+753) 0 3336 (+753)
github.com/rocket-pool/smartnode/shared/services/network_state_provider.go 0.00% (ø) 534 (+534) 0 534 (+534)
github.com/rocket-pool/smartnode/shared/services/proposals/proposal-manager.go 0.00% (ø) 2049 (+153) 0 2049 (+153)
github.com/rocket-pool/smartnode/shared/services/requirements.go 0.00% (ø) 4445 (+723) 0 4445 (+723)
github.com/rocket-pool/smartnode/shared/services/services.go 0.00% (ø) 2466 (+442) 0 2466 (+442)
github.com/rocket-pool/smartnode/shared/services/state/network-state.go 8.21% (+1.53%) 3447 (+364) 283 (+77) 3164 (+287) 👍
github.com/rocket-pool/smartnode/shared/services/state/provider.go 0.00% (ø) 0 0 0
github.com/rocket-pool/smartnode/shared/services/state/static_bc.go 0.00% (ø) 943 (+943) 0 943 (+943)
github.com/rocket-pool/smartnode/shared/services/state/static_ec.go 0.00% (ø) 393 (+393) 0 393 (+393)
github.com/rocket-pool/smartnode/shared/services/state/static_mode.go 0.00% (ø) 0 0 0
github.com/rocket-pool/smartnode/shared/services/state/static_provider.go 19.73% (+19.73%) 299 (+299) 59 (+59) 240 (+240) 🎉
github.com/rocket-pool/smartnode/treegen/tree-gen.go 0.00% (ø) 4270 (+304) 0 4270 (+304)

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Changed unit test files

  • github.com/rocket-pool/smartnode/rocketpool/node/verify-pdao-props-state_test.go
  • github.com/rocket-pool/smartnode/rocketpool/watchtower/submit-network-balances-state_test.go
  • github.com/rocket-pool/smartnode/shared/services/state/static_provider_test.go

@0xfornax 0xfornax marked this pull request as ready for review May 26, 2026 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants